﻿    <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ProjectFitus.Models.NewsContent>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Brjostagjof.is | Fréttir
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="search-area">
        <input type="text" id="searchText" name="searchText" /> <input type="button" id="searchButton" value="Leit" />
        <hr />
    <div>
    <% if (User.IsInRole("Administrators"))
       { %>    
        <p>
            <%= Html.ActionLink("Búa til nýja frétt", "Create") %>
        </p>
    <% } %>
    </div>
    </div>
    <% foreach (var item in Model) 
    { %>
        <div class="list-news">
        <h3><%= Html.ActionLink(item.title, "Details", new { id = item.id })%></h3>
        <h4><%= Html.Encode(String.Format("{0:g}", item.dateCreated)) %></h4>
        <p><%= Server.HtmlDecode(item.introText) %></p>
        <br style="clear:both;" />
    
    
        <% if (User.IsInRole("Administrators"))
           { %>
                <p>
                <%= Html.ActionLink("Breyta", "Edit", new { id = item.id })%> |
                <%= Html.ActionLink("Eyða", "Delete", new { id=item.id })%>
                </p>
        <% } %>
        </div>
    <%} %>
    <hr />
    
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="SideContent" runat="server">
</asp:Content>

